using Dew.Math;
using Dew.Math.Units;
namespace Dew.Examples()
{
void Example()
{
TOpenCLVector a,b,c;
double[] ac;
clMtxVec.CreateIt(
out a,
out b,
out c);
try
{
a.SetIt(
false,
new double[] {1,2,3,4});
b.SetIt(
false,
new double[] {5,6,7,8});
c.DotProd(0, a, b);
// c[0] = 1*5 + 2*6 + * 3*7 + 4*8
c.DotProd(1, a, b);
// c[0] = 1*5 + 2*6 + * 3*7 + 4*8
c.DotProd(2, a, b);
// c[0] = 1*5 + 2*6 + * 3*7 + 4*8
c.CopyToArray(ac);
//ac = [70, 70, 70]
}
finally
{
clMtxVec.FreeIt(
ref a,
ref b,
ref c);
}
}
}